package com.example.mydy.model;

import com.google.gson.annotations.SerializedName;

import java.util.List;

public class InvitationResponse {
    @SerializedName("success")
    private boolean success;
    
    @SerializedName("message")
    private String message;
    
    @SerializedName("data")
    private InvitationData data;
    
    @SerializedName("counts")
    private InvitationCounts counts;
    
    public boolean isSuccess() {
        return success;
    }
    
    public String getMessage() {
        return message;
    }
    
    public InvitationData getData() {
        return data;
    }
    
    public InvitationCounts getCounts() {
        return counts;
    }
    
    // 添加便捷方法，以便在InviteActivity中使用
    public int getFirstLevelCount() {
        return counts != null ? counts.getLevel1() : 0;
    }
    
    public int getSecondLevelCount() {
        return counts != null ? counts.getLevel2() : 0;
    }
    
    public int getThirdLevelCount() {
        return counts != null ? counts.getLevel3() : 0;
    }
    
    public int getTotalCount() {
        return counts != null ? counts.getTotal() : 0;
    }
    
    public List<Invitee> getInvitees() {
        return data != null ? data.getLevel1() : null;
    }
    
    public static class InvitationData {
        @SerializedName("level1")
        private List<Invitee> level1;
        
        @SerializedName("level2")
        private List<Invitee> level2;
        
        @SerializedName("level3")
        private List<Invitee> level3;
        
        public List<Invitee> getLevel1() {
            return level1;
        }
        
        public List<Invitee> getLevel2() {
            return level2;
        }
        
        public List<Invitee> getLevel3() {
            return level3;
        }
    }
    
    public static class InvitationCounts {
        @SerializedName("level1")
        private int level1;
        
        @SerializedName("level2")
        private int level2;
        
        @SerializedName("level3")
        private int level3;
        
        @SerializedName("total")
        private int total;
        
        public int getLevel1() {
            return level1;
        }
        
        public int getLevel2() {
            return level2;
        }
        
        public int getLevel3() {
            return level3;
        }
        
        public int getTotal() {
            return total;
        }
    }
} 